﻿using System.ComponentModel.DataAnnotations;
using FreeSql.DataAnnotations;

namespace BlogData.Models;

/// <summary>
/// 博客文章
/// </summary>
public class Post {
    [Column(IsIdentity = false, IsPrimary = true)]
    public string PageId { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string PageTitle { get; set; }

    public string PageAuthor {  get; set; } 

    /// <summary>
    /// 文章标记，状态 1:正常  0:异常
    /// </summary>
    public string? Status { get; set; }

    // todo 新增 tag 功能

    /// <summary>
    /// 发表状态 1:发布  0:草稿（不发表的话就是草稿状态）
    /// </summary>
    public int IsPublish { get; set; }

    /// <summary>
    /// 内容（markdown格式）
    /// </summary>
    [MaxLength(-1)]
    public string? PageContext { get; set; }


    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 上次更新时间
    /// </summary>
    public DateTime UpdateTime { get; set; }

    /// <summary>
    /// 分类
    /// </summary>
    public string? PageCategory { get; set; }

    /// <summary>
    /// 文章版本
    /// </summary>
    public int? PageVersion { get; set; }
}